home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / os2 / fm2_25a.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1996-09-08  |  49KB  |  1,237 lines

  1. /****************************************************************************
  2.  * FM/2 2.x installation program copyright (c) 1993-96 by M. Kimes          *
  3.  ****************************************************************************
  4.  *                                                                          *
  5.  * This program creates folders to hold program and data objects,           *
  6.  * then creates program objects for each executable.  It only needs to be   *
  7.  * run once (unless you move the FM/2 directory -- see say notes at end).   *
  8.  * Run this program in the FM/2 directory (where you unpacked the archive). *
  9.  *                                                                          *
  10.  ****************************************************************************
  11.  *                                                                          *
  12.  * For unattended installation, call with /UNATTENDED as the first          *
  13.  * argument.  To avoid any WPS associations being set, use the              *
  14.  * /NOASSOC argument.  INSTALL /? for usage help.                           *
  15.  *                                                                          *
  16.  ****************************************************************************/
  17.  
  18. /* Identify ourself */
  19.  
  20. '@Echo off'
  21. 'cls'
  22.  
  23. say'     ┌───────────────────────────────────────────────────────────────────┐'
  24. say'     │                  FM/2 2.x Installation Program                    │'
  25. say'     │             FM/2 is copyright (c) 1993-96 by M. Kimes             │'
  26. say'     │                       All rights reserved                         │'
  27. say'     ├───────────────────────────────────────────────────────────────────┤'
  28. say'     ├───────────────────────────────────────────────────────────────────┤'
  29. say'     │                Have you read the READ.ME file yet?                │'
  30. say'     │        By running this program, you agree to the license          │'
  31. say'     │                     as specified in that file,                    │'
  32. say'     │      and it tells you how to install, so you should read it.      │'
  33. say'     │                             Please?                               │'
  34. say'     └───────────────────────────────────────────────────────────────────┘'
  35.  
  36. assocfilter = ';ASSOCFILTER=*.ZIP,*.ARC,*.LZH,*.ARJ,*.ZOO,*.MO0,READ.ME,README,README.1ST,README.OS2,REGISTER.TXT'
  37.  
  38. /* check arguments and adjust as required */
  39.  
  40. parse upper arg dummy1 dummy2
  41. if dummy1 = '/NOASSOC' then assocfilter = ''
  42. if dummy2 = '/NOASSOC' then assocfilter = ''
  43. if assocfilter = '' then say '     /NOASSOC = TRUE'
  44.  
  45. if dummy1 = '/UNATTENDED' then unattended = ''
  46. if dummy2 = '/UNATTENDED' then unattended = ''
  47. if unattended = '' then say '     /UNATTENDED = TRUE'
  48.  
  49. /* if user asked for usage help, give it */
  50.  
  51. if dummy1 = '/?' | dummy2 = '/?' then
  52. do
  53.   say ''
  54.   say 'Usage:  INSTALL [/NOASSOC] [/UNATTENDED]'
  55.   say ' /NOASSOC    = don''t set any WPS associations'
  56.   say ' /UNATTENDED = don''t ask any questions'
  57.   say ''
  58.   say 'Examples:'
  59.   say ' INSTALL'
  60.   say ' INSTALL /NOASSOC'
  61.   say ' INSTALL /UNATTENDED'
  62.   say ' INSTALL /NOASSOC /UNATTENDED'
  63.   exit
  64. end
  65.  
  66. /* see if we might be in the right directory... */
  67.  
  68. rc = stream('fm3.exe','c','query exists')
  69. if rc = '' then
  70. do
  71.   say 'Sorry, FM3.EXE not found.  Must not be right directory.  Terminating.'
  72.   exit
  73. end
  74.  
  75. /* tell user what we're doing */
  76.  
  77. say ''
  78. say 'This program creates objects for FM/2 and does some drudgework for you.'
  79. say ''
  80.  
  81. /* load rexx utility functions */
  82.  
  83. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  84. call SysLoadFuncs
  85.  
  86. /* give user a chance to hit CTRL-C */
  87.  
  88. if unattended = 'UNATTENDED' then
  89. do
  90.   call charout ,'  Press [Enter] to continue...'
  91.   dummy = ''
  92.   do until dummy = '0d'x
  93.     dummy = SysGetKey('NOECHO')
  94.   end
  95.   call charout ,'0d1b'x'[K'
  96. end
  97.  
  98. /* save current directory */
  99.  
  100. curdir = directory()
  101.  
  102. /* say it, then do it */
  103.  
  104. say "Creating File Manager/2 folders and objects..."
  105.  
  106. /* first, create FM/2 folder */
  107.  
  108. rc = stream('fm2fldr.ico','c','query exists')
  109. title = "File Manager/2"
  110. classname = 'WPFolder'
  111. location = '<WP_DESKTOP>'
  112. setup = ''
  113. if rc \= '' then setup = 'ICONFILE='rc';'
  114. setup = setup'OBJECTID=<FM3_Folder>'
  115. result = SysCreateObject(classname,title,location,setup,f)
  116.  
  117. if unattended = 'UNATTENDED' then
  118. do
  119.   if result = 0 then
  120.   do
  121.     assocfilter = ''
  122.     existed = ''
  123.     say ''
  124.     say 'The File Manager/2 folder already exists.'
  125.     call charout ,"Should I update the objects (it's painless)? (Y/N) "
  126.     dummy = ''
  127.     do forever
  128.       dummy = SysGetKey('NOECHO')
  129.       parse upper var dummy dummy
  130.       if dummy = '1b'x then dummy = 'N'
  131.       if dummy = '0d'x then dummy = 'Y'
  132.       if dummy = 'N' then leave
  133.       if dummy = 'Y' then leave
  134.     end
  135.     call charout ,dummy
  136.     say ''
  137.     if dummy = 'N' then exit
  138.   end
  139. end
  140. else
  141. do
  142.   if result = 0 then
  143.   do
  144.     assocfilter = ''
  145.     existed = ''
  146.     say 'Updating objects.'
  147.   end
  148. end
  149.  
  150. /* create objects in appropriate folders */
  151.  
  152. rc = stream('fm3.exe','c','query exists')
  153. if rc \= '' then
  154. do
  155.   title = "FM/2"
  156.   classname = 'WPProgram'
  157.   location = '<FM3_Folder>'
  158.   setup = 'EXENAME='rc';STARTUPDIR='curdir
  159.   if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  160.   setup = setup';OBJECTID=<FM/2>'
  161.   call SysCreateObject classname,title,location,setup,u
  162. end
  163.  
  164. rc = stream('fm4.exe','c','query exists')
  165. if rc \= '' then
  166. do
  167.   title = "FM/2 Lite"
  168.   classname = 'WPProgram'
  169.   location = '<FM3_Folder>'
  170.   setup = 'EXENAME='rc';STARTUPDIR='curdir
  171.   if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  172.   setup = setup';OBJECTID=<FM/2 LITE>'
  173.   call SysCreateObject classname,title,location,setup,u
  174. end
  175.  
  176. /* create toolbox folder in FM/2 folder */
  177. rc = stream('toolbox.ico','c','query exists')
  178. title = "FM/2 Tools"
  179. classname = 'WPFolder'
  180. location = '<FM3_Folder>'
  181. setup = ''
  182. if rc \= '' then setup = 'ICONFILE='rc';'
  183. setup = setup'OBJECTID=<FM3_Tools>'
  184. result = SysCreateObject(classname,title,location,setup,u)
  185.  
  186. /* create documentation folder in FM/2 folder */
  187. rc = stream('docs.ico','c','query exists')
  188. title = "FM/2 Docs"
  189. classname = 'WPFolder'
  190. location = '<FM3_Folder>'
  191. setup = ''
  192. if rc \= '' then setup = 'ICONFILE='rc';'
  193. setup = setup'OBJECTID=<FM3_Docs>'
  194. result = SysCreateObject(classname,title,location,setup,u)
  195.  
  196. rc = stream('av2.exe','c','query exists')
  197. if rc \= '' then
  198. do
  199.   title = "Archive Viewer/2"
  200.   classname = 'WPProgram'
  201.   location = '<FM3_Tools>'
  202.   setup = 'EXENAME='rc';STARTUPDIR='curdir''assocfilter
  203.   if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  204.   setup = setup';OBJECTID=<FM/2_AV/2>'
  205.   call SysCreateObject classname,title,location,setup,u
  206. end
  207.  
  208. rc = stream('eas.exe','c','query exists')
  209. if rc \= '' then
  210. do
  211.   title = "EA Viewer"
  212.   classname = 'WPProgram'
  213.   location = '<FM3_Tools>'
  214.   setup = 'EXENAME='rc';STARTUPDIR='curdir
  215.   if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  216.   setup = setup';OBJECTID=<FM/2_EAVIEW>'
  217.   call SysCreateObject classname,title,location,setup,u
  218. end
  219.  
  220. rc = stream('dirsize.exe','c','query exists')
  221. if rc \= '' then
  222. do
  223.   title = "Dir Sizes"
  224.   classname = 'WPProgram'
  225.   location = '<FM3_Tools>'
  226.   setup = 'EXENAME='rc';STARTUPDIR='curdir
  227.   if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  228.   setup = setup';OBJECTID=<FM/2_DIRSIZE>'
  229.   call SysCreateObject classname,title,location,setup,u
  230. end
  231.  
  232. rc = stream('makearc.exe','c','query exists')
  233. if rc \= '' then
  234. do
  235.   title = "Make Archive"
  236.   classname = 'WPProgram'
  237.   location = '<FM3_Tools>'
  238.   setup = 'EXENAME='rc';STARTUPDIR='curdir
  239.   if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  240.   setup = setup';OBJECTID=<FM/2_MAKEARC>'
  241.   call SysCreateObject classname,title,location,setup,u
  242. end
  243.  
  244. rc = stream('ini.exe','c','query exists')
  245. if rc \= '' then
  246. do
  247.   if assocfilter \= '' then assocfilter = ';ASSOCFILTER=*.INI'
  248.   title = "INI Viewer"
  249.   classname = 'WPProgram'
  250.   location = '<FM3_Tools>'
  251.   setup = 'EXENAME='rc';STARTUPDIR='curdir''assocfilter
  252.   if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  253.   setup = setup';OBJECTID=<FM/2_INIVIEW>'
  254.   call SysCreateObject classname,title,location,setup,u
  255. end
  256.  
  257. rc = stream('viewinfs.exe','c','query exists')
  258. if rc \= '' then
  259. do
  260.   title = "Bookshelf Viewer"
  261.   classname = 'WPProgram'
  262.   location = '<FM3_Tools>'
  263.   setup = 'EXENAME='rc';STARTUPDIR='curdir';OBJECTID=<FM/2_BOOKSHELF>'
  264.   call SysCreateObject classname,title,location,setup,u
  265.   title = "Helpfile Viewer"
  266.   classname = 'WPProgram'
  267.   location = '<FM3_Tools>'
  268.   setup = 'EXENAME='rc';PARAMETERS=DUMMY;STARTUPDIR='curdir
  269.   call SysCreateObject classname,title,location,setup,u
  270. end
  271.  
  272. rc = stream('killproc.exe','c','query exists')
  273. if rc \= '' then
  274. do
  275.   title = "Process Killer"
  276.   classname = 'WPProgram'
  277.   location = '<FM3_Tools>'
  278.   setup = 'EXENAME='rc';PARAMETERS=%;STARTUPDIR='curdir';OBJECTID=<FM/2_KILLPROC>'
  279.   call SysCreateObject classname,title,location,setup,u
  280. end
  281.  
  282. rc = stream('undel.exe','c','query exists')
  283. if rc \= '' then
  284. do
  285.   title = "Undeleter"
  286.   classname = 'WPProgram'
  287.   location = '<FM3_Tools>'
  288.   setup = 'EXENAME='rc';STARTUPDIR='curdir';OBJECTID=<FM/2_UNDEL>'
  289.   if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  290.   call SysCreateObject classname,title,location,setup,u
  291. end
  292.  
  293. rc = stream('vtree.exe','c','query exists')
  294. if rc \= '' then
  295. do
  296.   title = "Visual Tree"
  297.   classname = 'WPProgram'
  298.   location = '<FM3_Tools>'
  299.   setup = 'EXENAME='rc';STARTUPDIR='curdir';OBJECTID=<FM/2_VTREE>'
  300.   call SysCreateObject classname,title,location,setup,u
  301. end
  302.  
  303. rc = stream('vdir.exe','c','query exists')
  304. if rc \= '' then
  305. do
  306.   title = "Visual Directory"
  307.   classname = 'WPProgram'
  308.   location = '<FM3_Tools>'
  309.   setup = 'EXENAME='rc';STARTUPDIR='curdir';OBJECTID=<FM/2_VDIR>'
  310.   if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  311.   call SysCreateObject classname,title,location,setup,u
  312. end
  313.  
  314. rc = stream('vcollect.exe','c','query exists')
  315. if rc \= '' then
  316. do
  317.   title = "Collector"
  318.   classname = 'WPProgram'
  319.   location = '<FM3_Tools>'
  320.   setup = 'EXENAME='rc';STARTUPDIR='curdir';OBJECTID=<FM/2_VCOLLECT>'
  321.   call SysCreateObject classname,title,location,setup,u
  322.   title = "Seek and scan"
  323.   classname = 'WPProgram'
  324.   location = '<FM3_Tools>'
  325.   setup = 'EXENAME='rc';PARAMETERS=**;STARTUPDIR='curdir';OBJECTID=<FM/2_VSEEK>'
  326.   call SysCreateObject classname,title,location,setup,u
  327. end
  328.  
  329. rc = stream('global.exe','c','query exists')
  330. if rc \= '' then
  331. do
  332.   title = "Global File Viewer"
  333.   classname = 'WPProgram'
  334.   location = '<FM3_Tools>'
  335.   setup = 'EXENAME='rc';STARTUPDIR='curdir';OBJECTID=<FM/2_SEEALL>'
  336.   call SysCreateObject classname,title,location,setup,u
  337. end
  338.  
  339. rc = stream('databar.exe','c','query exists')
  340. if rc \= '' then
  341. do
  342.   title = "Databar"
  343.   classname = 'WPProgram'
  344.   location = '<FM3_Tools>'
  345.   setup = 'EXENAME='rc';STARTUPDIR='curdir';OBJECTID=<FM/2_DATABAR>'
  346.   call SysCreateObject classname,title,location,setup,u
  347. end
  348.  
  349. rc = stream('sysinfo.exe','c','query exists')
  350. if rc \= '' then
  351. do
  352.   title = "SysInfo"
  353.   classname = 'WPProgram'
  354.   location = '<FM3_Tools>'
  355.   setup = 'EXENAME='rc';STARTUPDIR='curdir';OBJECTID=<FM/2_SYSINFO>'
  356.   call SysCreateObject classname,title,location,setup,u
  357. end
  358.  
  359. rc = stream('fm2play.exe','c','query exists')
  360. if rc \= '' then
  361. do
  362.   title = "FM2Play"
  363.   classname = 'WPProgram'
  364.   location = '<FM3_Tools>'
  365.   setup = 'EXENAME='rc';OBJECTID=<FM/2_FM2PLAY>;PARAMETERS=/! %*'
  366.   call SysCreateObject classname,title,location,setup,u
  367. end
  368. else
  369. do
  370.   rc = stream('utils\fm2play.exe','c','query exists')
  371.   if rc \= '' then
  372.   do
  373.     title = "FM2Play"
  374.     classname = 'WPProgram'
  375.     location = '<FM3_Tools>'
  376.     setup = 'EXENAME='rc';OBJECTID=<FM/2_FM2PLAY>;PARAMETERS=/! %*'
  377.     call SysCreateObject classname,title,location,setup,u
  378.   end
  379. end
  380.  
  381. rc = stream('READ.ME','c','query exists')
  382. if rc \= '' then
  383. do
  384.   title = "READ.ME"
  385.   classname = 'WPShadow'
  386.   location = '<FM3_Docs>'
  387.   setup = 'SHADOWID='rc
  388.   call SysCreateObject classname,title,location,setup,u
  389. end
  390.  
  391. rc = stream('HISTORY.TXT','c','query exists')
  392. if rc \= '' then
  393. do
  394.   title = "HISTORY.TXT"
  395.   classname = 'WPShadow'
  396.   location = '<FM3_Docs>'
  397.   setup = 'SHADOWID='rc
  398.   call SysCreateObject classname,title,location,setup,u
  399. end
  400.  
  401. rc = stream('REGISTER.TXT','c','query exists')
  402. if rc \= '' then
  403. do
  404.   title = "REGISTER.TXT"
  405.   classname = 'WPShadow'
  406.   location = '<FM3_Docs>'
  407.   setup = 'SHADOWID='rc
  408.   call SysCreateObject classname,title,location,setup,u
  409. end
  410.  
  411. rc = stream('BMTORDER.FRM','c','query exists')
  412. if rc \= '' then
  413. do
  414.   title = "BMTORDER.FRM"
  415.   classname = 'WPShadow'
  416.   location = '<FM3_Docs>'
  417.   setup = 'SHADOWID='rc
  418.   call SysCreateObject classname,title,location,setup,u
  419. end
  420.  
  421. rc = stream('FM3.HLP','c','query exists')
  422. if rc \= '' then
  423. do
  424.   if assocfilter \= '' then assocfilter=';ASSOCFILTER=*.HLP'
  425.   rc = stream('SEEHELP.EXE','c','query exists')
  426.   if rc \= '' then
  427.   do
  428.     title = "FM/2 Online Help"
  429.     classname = 'WPProgram'
  430.     location = '<FM3_Docs>'
  431.     setup = 'EXENAME='rc';STARTUPDIR='curdir';PARAMETERS= %* 'curdir'\FM3.HLP'
  432.     call SysCreateObject classname,title,location,setup,u
  433.   end
  434. end
  435.  
  436. rc = stream('UTILS\MAKEOBJ.CMD','c','query exists')
  437. if rc \= '' then
  438. do
  439.   title = "Make Object"
  440.   classname = 'WPProgram'
  441.   location = '<FM3_Tools>'
  442.   setup = 'EXENAME='rc';PARAMETERS=%*'
  443.   call SysCreateObject classname,title,location,setup,u
  444. end
  445.  
  446. rc = stream('UTILS\FM2UTILS.DOC','c','query exists')
  447. if rc \= '' then
  448. do
  449.   title = "FM2UTILS.DOC"
  450.   classname = 'WPShadow'
  451.   location = '<FM3_Docs>'
  452.   setup = 'SHADOWID='rc
  453.   call SysCreateObject classname,title,location,setup,u
  454. end
  455.  
  456. /* create sample customizations for the user so they don't start 'blank' */
  457.  
  458. rc = stream('FM3MENU.DAT','c','query exists')
  459. if rc = '' then
  460. do
  461.   rc = stream('FM2MENU.TMP','c','query exists')
  462.   if rc \= '' then
  463.   do
  464.     say 'Creating a sample FM3MENU.DAT file for you.'
  465.     'REN FM3MENU.TMP FM3MENU.DAT 1>NUL 2>NUL'
  466.   end
  467. end
  468. 'DEL FM3MENU.TMP 1>NUL 2>NUL'
  469. rc = stream('ASSOC.DAT','c','query exists')
  470. if rc = '' then
  471. do
  472.   rc = stream('ASSOC.TMP','c','query exists')
  473.   if rc \= '' then
  474.   do
  475.     say 'Creating a sample ASSOC.DAT file for you.'
  476.     'REN ASSOC.TMP ASSOC.DAT 1>NUL 2>NUL'
  477.   end
  478. end
  479. 'DEL ASSOC.TMP 1>NUL 2>NUL'
  480. rc = stream('COMMANDS.DAT','c','query exists')
  481. if rc = '' then
  482. do
  483.   rc = stream('COMMANDS.TMP','c','query exists')
  484.   if rc \= '' then
  485.   do
  486.     say 'Creating a sample COMMANDS.DAT file for you.'
  487.     'REN COMMANDS.TMP COMMANDS.DAT 1>NUL 2>NUL'
  488.   end
  489. end
  490. 'DEL COMMANDS.TMP 1>NUL 2>NUL'
  491. rc = stream('FILTERS.DAT','c','query exists')
  492. if rc = '' then
  493. do
  494.   rc = stream('FILTERS.TMP','c','query exists')
  495.   if rc \= '' then
  496.   do
  497.     say 'Creating a sample FILTERS.DAT file for you.'
  498.     'REN FILTERS.TMP FILTERS.DAT 1>NUL 2>NUL'
  499.   end
  500. end
  501. 'DEL FILTERS.TMP 1>NUL 2>NUL'
  502. rc = stream('FM3TOOLS.DAT','c','query exists')
  503. if rc = '' then
  504. do
  505.   rc = stream('FM3TOOLS.TMP','c','query exists')
  506.   if rc \= '' then
  507.   do
  508.     say 'Installing an FM3TOOLS.DAT file for you.'
  509.     'REN FM3TOOLS.TMP FM3TOOLS.DAT 1>NUL 2>NUL'
  510.   end
  511. end
  512. 'DEL FM3TOOLS.TMP 1>NUL 2>NUL'
  513. rc = stream('QUICKTLS.DAT','c','query exists')
  514. if rc = '' then
  515. do
  516.   rc = stream('QUICKTLS.TMP','c','query exists')
  517.   if rc \= '' then
  518.   do
  519.     rc = stream('CMDS.TMP','c','query exists')
  520.     if rc \= '' then
  521.     do
  522.       rc = stream('UTILS.TMP','c','query exists')
  523.       if rc \= '' then
  524.       do
  525.         rc = stream('SORT.TMP','c','query exists')
  526.         if rc \= '' then
  527.         do
  528.           rc = stream('SELECT.TMP','c','query exists')
  529.           if rc \= '' then
  530.           do
  531.             say 'Creating a sample QUICKTLS.DAT file and toolboxes for you.'
  532.             'REN QUICKTLS.TMP QUICKTLS.DAT 1>NUL 2>NUL'
  533.             'REN CMDS.TMP CMDS.TLS 1>NUL 2>NUL'
  534.             'REN UTILS.TMP UTILS.TLS 1>NUL 2>NUL'
  535.             'REN SORT.TMP SORT.TLS 1>NUL 2>NUL'
  536.             'REN SELECT.TMP SELECT.TLS 1>NUL 2>NUL'
  537.           end
  538.           'DEL SELECT.TMP 1>NUL 2>NUL'
  539.         end
  540.        'DEL SORT.TMP 1>NUL 2>NUL'
  541.       end
  542.       'DEL UTILS.TMP 1>NUL 2>NUL'
  543.     end
  544.     'DEL CMDS.TMP 1>NUL 2>NUL'
  545.   end
  546. end
  547. 'DEL QUICKTLS.TMP 1>NUL 2>NUL'
  548.  
  549. /*
  550.  * create command files that the user can execute from anywhere (we'll
  551.  * ask the user to put this utils directory on the PATH) and that other
  552.  * programs can execute to use FM/2 as "their" file manager.
  553.  */
  554.  
  555. 'del SETENV.CMD 1>NUL 2>NUL'
  556. dummy = stream('SETENV.CMD','C','open')
  557. if dummy = 'READY:' then
  558. do
  559.   call lineout 'SETENV.CMD','@ECHO OFF'
  560.   call lineout 'SETENV.CMD','REM'
  561.   call lineout 'SETENV.CMD','REM If you prefer, you can call this .CMD file'
  562.   call lineout 'SETENV.CMD','REM instead of altering the PATH= statement in'
  563.   call lineout 'SETENV.CMD','REM CONFIG.SYS to gain access to the FM/2'
  564.   call lineout 'SETENV.CMD','REM command line utilities.'
  565.   call lineout 'SETENV.CMD','REM'
  566.   call lineout 'SETENV.CMD','IF "%FM2ENVSET%" == "" GOTO INSTALL'
  567.   call lineout 'SETENV.CMD','GOTO SKIP'
  568.   call lineout 'SETENV.CMD',':INSTALL'
  569.   call lineout 'SETENV.CMD','SET FM2ENVSET=YES'
  570.   call lineout 'SETENV.CMD','SET PATH=%PATH%;'curdir'\utils;'
  571.   call lineout 'SETENV.CMD','SET BEGINLIBPATH='curdir
  572.   call lineout 'SETENV.CMD','SET FM3INI='curdir
  573.   call lineout 'SETENV.CMD','ECHO Path set for FM/2 and utilities.'
  574.   call lineout 'SETENV.CMD','GOTO END'
  575.   call lineout 'SETENV.CMD',':SKIP'
  576.   call lineout 'SETENV.CMD','ECHO Paths already set for FM/2 and utilities.'
  577.   call lineout 'SETENV.CMD',':END'
  578.   call stream 'SETENV.CMD','C','close'
  579. end
  580.  
  581. /*
  582.  * place an object for SETENV.CMD in folder so user doesn't have to diddle
  583.  * their PATH statement if they don't want to for command line work.
  584.  */
  585.  
  586.  
  587. rc = stream('SETENV.CMD','c','query exists')
  588. if rc \= '' then
  589. do
  590.   dummy = value('COMSPEC',,'OS2ENVIRONMENT')
  591.   if dummy = '' then dummy = value('OS2_SHELL',,'OS2ENVIRONMENT')
  592.   if dummy = '' then dummy = 'CMD.EXE'
  593.   title = "FM/2 Utilities command line"
  594.   classname = 'WPProgram'
  595.   location = '<FM3_Tools>'
  596.   setup = 'EXENAME='dummy';PARAMETERS=/K 'rc';STARTUPDIR=C:\'
  597.   call SysCreateObject classname,title,location,setup,u
  598. end
  599.  
  600. call SysMkDir curdir'\UTILS'
  601. dummy = directory(curdir'\UTILS')
  602. if dummy = curdir'\UTILS' then
  603. do
  604.   'set PATH=%PATH%;'curdir'\utils'
  605.   'move ..\example.cmd 1>NUL 2>NUL'
  606.   'del FM2.CMD 1>NUL 2>NUL'
  607.   dummy = stream('FM2.CMD','C','open')
  608.   if dummy = 'READY:' then
  609.   do
  610.     say 'Creating an FM2.CMD file.'
  611.     call lineout 'FM2.CMD', "/* FM/2 command file.  Locate in a directory"
  612.     call lineout 'FM2.CMD', " * on your PATH. */"
  613.     call lineout 'FM2.CMD', "'@echo off'"
  614.       call lineout 'FM2.CMD', "mydir = directory()"
  615.       call lineout 'FM2.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  616.       call lineout 'FM2.CMD', "if arg1 \= '' then "
  617.       call lineout 'FM2.CMD', "do"
  618.       call lineout 'FM2.CMD', "  if left(arg1,1,1) \= '/' then"
  619.       call lineout 'FM2.CMD', "  do"
  620.       call lineout 'FM2.CMD', "    arg0 = arg1"
  621.       call lineout 'FM2.CMD', "    arg1 = stream(arg1,'c','query exists')"
  622.       call lineout 'FM2.CMD', "    if arg1 = '' then"
  623.       call lineout 'FM2.CMD', "    do"
  624.       call lineout 'FM2.CMD', "      arg1 = directory(arg0)"
  625.       call lineout 'FM2.CMD', "      call directory mydir"
  626.       call lineout 'FM2.CMD', "    end"
  627.       call lineout 'FM2.CMD', "  end"
  628.       call lineout 'FM2.CMD', "end"
  629.       call lineout 'FM2.CMD', "else arg1 = mydir"
  630.       call lineout 'FM2.CMD', "if arg2 \= '' then "
  631.       call lineout 'FM2.CMD', "do"
  632.       call lineout 'FM2.CMD', "  if left(arg2,1,1) \= '/' then"
  633.       call lineout 'FM2.CMD', "  do"
  634.       call lineout 'FM2.CMD', "    arg0 = arg2"
  635.       call lineout 'FM2.CMD', "    arg2 = stream(arg2,'c','query exists')"
  636.       call lineout 'FM2.CMD', "    if arg2 = '' then"
  637.       call lineout 'FM2.CMD', "    do"
  638.       call lineout 'FM2.CMD', "      arg2 = directory(arg0)"
  639.       call lineout 'FM2.CMD', "      call directory mydir"
  640.       call lineout 'FM2.CMD', "    end"
  641.       call lineout 'FM2.CMD', "  end"
  642.       call lineout 'FM2.CMD', "end"
  643.       call lineout 'FM2.CMD', "if arg3 \= '' then "
  644.       call lineout 'FM2.CMD', "do"
  645.       call lineout 'FM2.CMD', "  if left(arg3,1,1) \= '/' then"
  646.       call lineout 'FM2.CMD', "  do"
  647.       call lineout 'FM2.CMD', "    arg0 = arg3"
  648.       call lineout 'FM2.CMD', "    arg3 = stream(arg3,'c','query exists')"
  649.       call lineout 'FM2.CMD', "    if arg3 = '' then"
  650.       call lineout 'FM2.CMD', "    do"
  651.       call lineout 'FM2.CMD', "      arg3 = directory(arg0)"
  652.       call lineout 'FM2.CMD', "      call directory mydir"
  653.       call lineout 'FM2.CMD', "    end"
  654.       call lineout 'FM2.CMD', "  end"
  655.       call lineout 'FM2.CMD', "end"
  656.       call lineout 'FM2.CMD', "if arg4 \= '' then "
  657.       call lineout 'FM2.CMD', "do"
  658.       call lineout 'FM2.CMD', "  if left(arg4,1,1) \= '/' then"
  659.       call lineout 'FM2.CMD', "  do"
  660.       call lineout 'FM2.CMD', "    arg0 = arg4"
  661.       call lineout 'FM2.CMD', "    arg4 = stream(arg4,'c','query exists')"
  662.       call lineout 'FM2.CMD', "    if arg4 = '' then"
  663.       call lineout 'FM2.CMD', "    do"
  664.       call lineout 'FM2.CMD', "      arg4 = directory(arg0)"
  665.       call lineout 'FM2.CMD', "      call directory mydir"
  666.       call lineout 'FM2.CMD', "    end"
  667.       call lineout 'FM2.CMD', "  end"
  668.       call lineout 'FM2.CMD', "end"
  669.       call lineout 'FM2.CMD', "if arg5 \= '' then "
  670.       call lineout 'FM2.CMD', "do"
  671.       call lineout 'FM2.CMD', "  if left(arg5,1,1) \= '/' then"
  672.       call lineout 'FM2.CMD', "  do"
  673.       call lineout 'FM2.CMD', "    arg0 = arg5"
  674.       call lineout 'FM2.CMD', "    arg5 = stream(arg5,'c','query exists')"
  675.       call lineout 'FM2.CMD', "    if arg5 = '' then"
  676.       call lineout 'FM2.CMD', "    do"
  677.       call lineout 'FM2.CMD', "      arg5 = directory(arg0)"
  678.       call lineout 'FM2.CMD', "      call directory mydir"
  679.       call lineout 'FM2.CMD', "    end"
  680.       call lineout 'FM2.CMD', "  end"
  681.       call lineout 'FM2.CMD', "end"
  682.       call lineout 'FM2.CMD', "if arg6 \= '' then "
  683.       call lineout 'FM2.CMD', "do"
  684.       call lineout 'FM2.CMD', "  if left(arg6,1,1) \= '/' then"
  685.       call lineout 'FM2.CMD', "  do"
  686.       call lineout 'FM2.CMD', "    arg0 = arg6"
  687.       call lineout 'FM2.CMD', "    arg6 = stream(arg6,'c','query exists')"
  688.       call lineout 'FM2.CMD', "    if arg6 = '' then"
  689.       call lineout 'FM2.CMD', "    do"
  690.       call lineout 'FM2.CMD', "      arg6 = directory(arg0)"
  691.       call lineout 'FM2.CMD', "      call directory mydir"
  692.       call lineout 'FM2.CMD', "    end"
  693.       call lineout 'FM2.CMD', "  end"
  694.       call lineout 'FM2.CMD', "end"
  695.       call lineout 'FM2.CMD', "if arg7 \= '' then "
  696.       call lineout 'FM2.CMD', "do"
  697.       call lineout 'FM2.CMD', "  if left(arg7,1,1) \= '/' then"
  698.       call lineout 'FM2.CMD', "  do"
  699.       call lineout 'FM2.CMD', "    arg0 = arg7"
  700.       call lineout 'FM2.CMD', "    arg7 = stream(arg7,'c','query exists')"
  701.       call lineout 'FM2.CMD', "    if arg7 = '' then"
  702.       call lineout 'FM2.CMD', "    do"
  703.       call lineout 'FM2.CMD', "      arg7 = directory(arg0)"
  704.       call lineout 'FM2.CMD', "      call directory mydir"
  705.       call lineout 'FM2.CMD', "    end"
  706.       call lineout 'FM2.CMD', "  end"
  707.       call lineout 'FM2.CMD', "end"
  708.       call lineout 'FM2.CMD', "if arg8 \= '' then "
  709.       call lineout 'FM2.CMD', "do"
  710.       call lineout 'FM2.CMD', "  if left(arg8,1,1) \= '/' then"
  711.       call lineout 'FM2.CMD', "  do"
  712.       call lineout 'FM2.CMD', "    arg0 = arg8"
  713.       call lineout 'FM2.CMD', "    arg8 = stream(arg8,'c','query exists')"
  714.       call lineout 'FM2.CMD', "    if arg8 = '' then"
  715.       call lineout 'FM2.CMD', "    do"
  716.       call lineout 'FM2.CMD', "      arg8 = directory(arg0)"
  717.       call lineout 'FM2.CMD', "      call directory mydir"
  718.       call lineout 'FM2.CMD', "    end"
  719.       call lineout 'FM2.CMD', "  end"
  720.       call lineout 'FM2.CMD', "end"
  721.       call lineout 'FM2.CMD', "if arg9 \= '' then "
  722.       call lineout 'FM2.CMD', "do"
  723.       call lineout 'FM2.CMD', "  if left(arg9,1,1) \= '/' then"
  724.       call lineout 'FM2.CMD', "  do"
  725.       call lineout 'FM2.CMD', "    arg0 = arg9"
  726.       call lineout 'FM2.CMD', "    arg9 = stream(arg9,'c','query exists')"
  727.       call lineout 'FM2.CMD', "    if arg9 = '' then"
  728.       call lineout 'FM2.CMD', "    do"
  729.       call lineout 'FM2.CMD', "      arg9 = directory(arg0)"
  730.       call lineout 'FM2.CMD', "      call directory mydir"
  731.       call lineout 'FM2.CMD', "    end"
  732.       call lineout 'FM2.CMD', "  end"
  733.       call lineout 'FM2.CMD', "end"
  734.     call lineout 'FM2.CMD', "n = setlocal()"
  735.     call lineout 'FM2.CMD', "n = directory('"curdir"')"
  736.     call lineout 'FM2.CMD', "'start fm3.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  737.     call lineout 'FM2.CMD', "n = endlocal()"
  738.     call stream 'FM2.CMD','C','close'
  739.     'del AV2.CMD 1>NUL 2>NUL'
  740.     dummy = stream('AV2.CMD','C','open')
  741.     if dummy = 'READY:' then
  742.     do
  743.       say 'Creating an AV2.CMD file.'
  744.       call lineout 'AV2.CMD', "@echo off"
  745.       call lineout 'AV2.CMD', "rem AV/2 command file.  Locate in a directory"
  746.       call lineout 'AV2.CMD', "rem on your PATH."
  747.       call lineout 'AV2.CMD', "setlocal"
  748.       call lineout 'AV2.CMD', "set FM3INI="curdir
  749.       call lineout 'AV2.CMD', "set BEGINLIBPATH="curdir
  750.       call lineout 'AV2.CMD', "start "curdir"\av2.exe %1 %2 %3 %4 %5 %6 %7 %8 %9"
  751.       call lineout 'AV2.CMD', "endlocal"
  752.       call stream 'AV2.CMD','C','close'
  753.     end
  754.     else say "Couldn't create AV2.CMD file."
  755.     'del VDIR.CMD 1>NUL 2>NUL'
  756.     dummy = stream('VDIR.CMD','C','open')
  757.     if dummy = 'READY:' then
  758.     do
  759.       say 'Creating a VDIR.CMD file.'
  760.       call lineout 'VDIR.CMD', "/* VDIR (FM/2) command file.  Locate in a directory"
  761.       call lineout 'VDIR.CMD', " * on your PATH. */"
  762.       call lineout 'VDIR.CMD', "'@echo off'"
  763.       call lineout 'VDIR.CMD', "mydir = directory()"
  764.       call lineout 'VDIR.CMD', "arg arg1 arg2"
  765.       call lineout 'VDIR.CMD', "if arg1 \= '' then "
  766.       call lineout 'VDIR.CMD', "do"
  767.       call lineout 'VDIR.CMD', "  if left(arg1,1,1) \= '/' then"
  768.       call lineout 'VDIR.CMD', "  do"
  769.       call lineout 'VDIR.CMD', "    arg0 = arg1"
  770.       call lineout 'VDIR.CMD', "    arg1 = stream(arg1,'c','query exists')"
  771.       call lineout 'VDIR.CMD', "    if arg1 = '' then"
  772.       call lineout 'VDIR.CMD', "    do"
  773.       call lineout 'VDIR.CMD', "      arg1 = directory(arg0)"
  774.       call lineout 'VDIR.CMD', "      call directory mydir"
  775.       call lineout 'VDIR.CMD', "    end"
  776.       call lineout 'VDIR.CMD', "  end"
  777.       call lineout 'VDIR.CMD', "end"
  778.       call lineout 'VDIR.CMD', "else arg1 = mydir"
  779.       call lineout 'VDIR.CMD', "n = setlocal()"
  780.       call lineout 'VDIR.CMD', "n = directory('"curdir"')"
  781.       call lineout 'VDIR.CMD', "'start vdir.exe 'arg1 '%2 %3 %4 %5 %6 %7 %8 %9'"
  782.       call lineout 'VDIR.CMD', "n = endlocal()"
  783.       call stream 'VDIR.CMD','C','close'
  784.     end
  785.     else say "Couldn't create VDIR.CMD file."
  786.     'del VTREE.CMD 1>NUL 2>NUL'
  787.     dummy = stream('VTREE.CMD','C','open')
  788.     if dummy = 'READY:' then
  789.     do
  790.       say 'Creating a VTREE.CMD file.'
  791.       call lineout 'VTREE.CMD', "/* VTREE (FM/2) command file.  Locate in a directory"
  792.       call lineout 'VTREE.CMD', " * on your PATH. */"
  793.       call lineout 'VTREE.CMD', "'@echo off'"
  794.       call lineout 'VTREE.CMD', "n = setlocal()"
  795.       call lineout 'VTREE.CMD', "n = directory('"curdir"')"
  796.       call lineout 'VTREE.CMD', "'start vtree.exe %1 %2 %3 %4 %5 %6 %7 %8 %9'"
  797.       call lineout 'VTREE.CMD', "n = endlocal()"
  798.       call stream 'VTREE.CMD','C','close'
  799.     end
  800.     else say "Couldn't create VTREE.CMD file."
  801.     'del VCOLLECT.CMD 1>NUL 2>NUL'
  802.     dummy = stream('VCOLLECT.CMD','C','open')
  803.     if dummy = 'READY:' then
  804.     do
  805.       say 'Creating a VCOLLECT.CMD file.'
  806.       call lineout 'VCOLLECT.CMD', "/* VCOLLECT (FM/2) command file.  Locate in a directory"
  807.       call lineout 'VCOLLECT.CMD', " * on your PATH. */"
  808.       call lineout 'VCOLLECT.CMD', "'@echo off'"
  809.       call lineout 'VCOLLECT.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  810.       call lineout 'VCOLLECT.CMD', "if arg1 \= '' then "
  811.       call lineout 'VCOLLECT.CMD', "do"
  812.       call lineout 'VCOLLECT.CMD', "  if left(arg1,1,1) \= '/' then"
  813.       call lineout 'VCOLLECT.CMD', "  do"
  814.       call lineout 'VCOLLECT.CMD', "    arg1 = stream(arg1,'c','query exists')"
  815.       call lineout 'VCOLLECT.CMD', "  end"
  816.       call lineout 'VCOLLECT.CMD', "end"
  817.       call lineout 'VCOLLECT.CMD', "if arg2 \= '' then "
  818.       call lineout 'VCOLLECT.CMD', "do"
  819.       call lineout 'VCOLLECT.CMD', "  if left(arg2,1,1) \= '/' then"
  820.       call lineout 'VCOLLECT.CMD', "  do"
  821.       call lineout 'VCOLLECT.CMD', "    arg2 = stream(arg2,'c','query exists')"
  822.       call lineout 'VCOLLECT.CMD', "  end"
  823.       call lineout 'VCOLLECT.CMD', "end"
  824.       call lineout 'VCOLLECT.CMD', "if arg3 \= '' then "
  825.       call lineout 'VCOLLECT.CMD', "do"
  826.       call lineout 'VCOLLECT.CMD', "  if left(arg3,1,1) \= '/' then"
  827.       call lineout 'VCOLLECT.CMD', "  do"
  828.       call lineout 'VCOLLECT.CMD', "    arg3 = stream(arg3,'c','query exists')"
  829.       call lineout 'VCOLLECT.CMD', "  end"
  830.       call lineout 'VCOLLECT.CMD', "end"
  831.       call lineout 'VCOLLECT.CMD', "if arg4 \= '' then "
  832.       call lineout 'VCOLLECT.CMD', "do"
  833.       call lineout 'VCOLLECT.CMD', "  if left(arg4,1,1) \= '/' then"
  834.       call lineout 'VCOLLECT.CMD', "  do"
  835.       call lineout 'VCOLLECT.CMD', "    arg4 = stream(arg4,'c','query exists')"
  836.       call lineout 'VCOLLECT.CMD', "  end"
  837.       call lineout 'VCOLLECT.CMD', "end"
  838.       call lineout 'VCOLLECT.CMD', "if arg5 \= '' then "
  839.       call lineout 'VCOLLECT.CMD', "do"
  840.       call lineout 'VCOLLECT.CMD', "  if left(arg5,1,1) \= '/' then"
  841.       call lineout 'VCOLLECT.CMD', "  do"
  842.       call lineout 'VCOLLECT.CMD', "    arg5 = stream(arg5,'c','query exists')"
  843.       call lineout 'VCOLLECT.CMD', "  end"
  844.       call lineout 'VCOLLECT.CMD', "end"
  845.       call lineout 'VCOLLECT.CMD', "if arg6 \= '' then "
  846.       call lineout 'VCOLLECT.CMD', "do"
  847.       call lineout 'VCOLLECT.CMD', "  if left(arg6,1,1) \= '/' then"
  848.       call lineout 'VCOLLECT.CMD', "  do"
  849.       call lineout 'VCOLLECT.CMD', "    arg6 = stream(arg6,'c','query exists')"
  850.       call lineout 'VCOLLECT.CMD', "  end"
  851.       call lineout 'VCOLLECT.CMD', "end"
  852.       call lineout 'VCOLLECT.CMD', "if arg7 \= '' then "
  853.       call lineout 'VCOLLECT.CMD', "do"
  854.       call lineout 'VCOLLECT.CMD', "  if left(arg7,1,1) \= '/' then"
  855.       call lineout 'VCOLLECT.CMD', "  do"
  856.       call lineout 'VCOLLECT.CMD', "    arg7 = stream(arg7,'c','query exists')"
  857.       call lineout 'VCOLLECT.CMD', "  end"
  858.       call lineout 'VCOLLECT.CMD', "end"
  859.       call lineout 'VCOLLECT.CMD', "if arg8 \= '' then "
  860.       call lineout 'VCOLLECT.CMD', "do"
  861.       call lineout 'VCOLLECT.CMD', "  if left(arg8,1,1) \= '/' then"
  862.       call lineout 'VCOLLECT.CMD', "  do"
  863.       call lineout 'VCOLLECT.CMD', "    arg8 = stream(arg8,'c','query exists')"
  864.       call lineout 'VCOLLECT.CMD', "  end"
  865.       call lineout 'VCOLLECT.CMD', "end"
  866.       call lineout 'VCOLLECT.CMD', "if arg9 \= '' then "
  867.       call lineout 'VCOLLECT.CMD', "do"
  868.       call lineout 'VCOLLECT.CMD', "  if left(arg9,1,1) \= '/' then"
  869.       call lineout 'VCOLLECT.CMD', "  do"
  870.       call lineout 'VCOLLECT.CMD', "    arg9 = stream(arg9,'c','query exists')"
  871.       call lineout 'VCOLLECT.CMD', "  end"
  872.       call lineout 'VCOLLECT.CMD', "end"
  873.       call lineout 'VCOLLECT.CMD', "n = setlocal()"
  874.       call lineout 'VCOLLECT.CMD', "n = directory('"curdir"')"
  875.       call lineout 'VCOLLECT.CMD', "'start vcollect.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  876.       call lineout 'VCOLLECT.CMD', "n = endlocal()"
  877.       call stream 'VCOLLECT.CMD','C','close'
  878.     end
  879.     else say "Couldn't create VCOLLECT.CMD file."
  880.     'del INI.CMD 1>NUL 2>NUL'
  881.     dummy = stream('INI.CMD','C','open')
  882.     if dummy = 'READY:' then
  883.     do
  884.       say 'Creating an INI.CMD file.'
  885.       call lineout 'INI.CMD', "/* INI (FM/2) command file.  Locate in a directory"
  886.       call lineout 'INI.CMD', " * on your PATH. */"
  887.       call lineout 'INI.CMD', "'@echo off'"
  888.       call lineout 'INI.CMD', "arg arg1"
  889.       call lineout 'INI.CMD', "if arg1 \= '' then arg1 = stream(arg1,'c','query exists')"
  890.       call lineout 'INI.CMD', "n = setlocal()"
  891.       call lineout 'INI.CMD', "n = directory('"curdir"')"
  892.       call lineout 'INI.CMD', "'start INI.exe 'arg1"
  893.       call lineout 'INI.CMD', "n = endlocal()"
  894.       call stream 'INI.CMD','C','close'
  895.     end
  896.     else say "Couldn't create INI.CMD file."
  897.     'del EAS.CMD 1>NUL 2>NUL'
  898.     dummy = stream('EAS.CMD','C','open')
  899.     if dummy = 'READY:' then
  900.     do
  901.       say 'Creating an EAS.CMD file.'
  902.       call lineout 'EAS.CMD', "/* EAS (FM/2) command file.  Locate in a directory"
  903.       call lineout 'EAS.CMD', " * on your PATH. */"
  904.       call lineout 'EAS.CMD', "'@echo off'"
  905.       call lineout 'EAS.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  906.       call lineout 'EAS.CMD', "if arg1 \= '' then "
  907.       call lineout 'EAS.CMD', "do"
  908.       call lineout 'EAS.CMD', "  if left(arg1,1,1) \= '/' then"
  909.       call lineout 'EAS.CMD', "  do"
  910.       call lineout 'EAS.CMD', "    arg1 = stream(arg1,'c','query exists')"
  911.       call lineout 'EAS.CMD', "  end"
  912.       call lineout 'EAS.CMD', "end"
  913.       call lineout 'EAS.CMD', "else arg1 = directory()"
  914.       call lineout 'EAS.CMD', "if arg2 \= '' then "
  915.       call lineout 'EAS.CMD', "do"
  916.       call lineout 'EAS.CMD', "  if left(arg2,1,1) \= '/' then"
  917.       call lineout 'EAS.CMD', "  do"
  918.       call lineout 'EAS.CMD', "    arg2 = stream(arg2,'c','query exists')"
  919.       call lineout 'EAS.CMD', "  end"
  920.       call lineout 'EAS.CMD', "end"
  921.       call lineout 'EAS.CMD', "if arg3 \= '' then "
  922.       call lineout 'EAS.CMD', "do"
  923.       call lineout 'EAS.CMD', "  if left(arg3,1,1) \= '/' then"
  924.       call lineout 'EAS.CMD', "  do"
  925.       call lineout 'EAS.CMD', "    arg3 = stream(arg3,'c','query exists')"
  926.       call lineout 'EAS.CMD', "  end"
  927.       call lineout 'EAS.CMD', "end"
  928.       call lineout 'EAS.CMD', "if arg4 \= '' then "
  929.       call lineout 'EAS.CMD', "do"
  930.       call lineout 'EAS.CMD', "  if left(arg4,1,1) \= '/' then"
  931.       call lineout 'EAS.CMD', "  do"
  932.       call lineout 'EAS.CMD', "    arg4 = stream(arg4,'c','query exists')"
  933.       call lineout 'EAS.CMD', "  end"
  934.       call lineout 'EAS.CMD', "end"
  935.       call lineout 'EAS.CMD', "if arg5 \= '' then "
  936.       call lineout 'EAS.CMD', "do"
  937.       call lineout 'EAS.CMD', "  if left(arg5,1,1) \= '/' then"
  938.       call lineout 'EAS.CMD', "  do"
  939.       call lineout 'EAS.CMD', "    arg5 = stream(arg5,'c','query exists')"
  940.       call lineout 'EAS.CMD', "  end"
  941.       call lineout 'EAS.CMD', "end"
  942.       call lineout 'EAS.CMD', "if arg6 \= '' then "
  943.       call lineout 'EAS.CMD', "do"
  944.       call lineout 'EAS.CMD', "  if left(arg6,1,1) \= '/' then"
  945.       call lineout 'EAS.CMD', "  do"
  946.       call lineout 'EAS.CMD', "    arg6 = stream(arg6,'c','query exists')"
  947.       call lineout 'EAS.CMD', "  end"
  948.       call lineout 'EAS.CMD', "end"
  949.       call lineout 'EAS.CMD', "if arg7 \= '' then "
  950.       call lineout 'EAS.CMD', "do"
  951.       call lineout 'EAS.CMD', "  if left(arg7,1,1) \= '/' then"
  952.       call lineout 'EAS.CMD', "  do"
  953.       call lineout 'EAS.CMD', "    arg7 = stream(arg7,'c','query exists')"
  954.       call lineout 'EAS.CMD', "  end"
  955.       call lineout 'EAS.CMD', "end"
  956.       call lineout 'EAS.CMD', "if arg8 \= '' then "
  957.       call lineout 'EAS.CMD', "do"
  958.       call lineout 'EAS.CMD', "  if left(arg8,1,1) \= '/' then"
  959.       call lineout 'EAS.CMD', "  do"
  960.       call lineout 'EAS.CMD', "    arg8 = stream(arg8,'c','query exists')"
  961.       call lineout 'EAS.CMD', "  end"
  962.       call lineout 'EAS.CMD', "end"
  963.       call lineout 'EAS.CMD', "if arg9 \= '' then "
  964.       call lineout 'EAS.CMD', "do"
  965.       call lineout 'EAS.CMD', "  if left(arg9,1,1) \= '/' then"
  966.       call lineout 'EAS.CMD', "  do"
  967.       call lineout 'EAS.CMD', "    arg9 = stream(arg9,'c','query exists')"
  968.       call lineout 'EAS.CMD', "  end"
  969.       call lineout 'EAS.CMD', "end"
  970.       call lineout 'EAS.CMD', "n = setlocal()"
  971.       call lineout 'EAS.CMD', "n = directory('"curdir"')"
  972.       call lineout 'EAS.CMD', "'start eas.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  973.       call lineout 'EAS.CMD', "n = endlocal()"
  974.       call stream 'EAS.CMD','C','close'
  975.     end
  976.     else say "Couldn't create EAS.CMD file."
  977.     'del DIRSIZE.CMD 1>NUL 2>NUL'
  978.     dummy = stream('DIRSIZE.CMD','C','open')
  979.     if dummy = 'READY:' then
  980.     do
  981.       say 'Creating a DIRSIZE.CMD file.'
  982.       call lineout 'DIRSIZE.CMD', "/* DIRSIZE (FM/2) command file.  Locate in a directory"
  983.       call lineout 'DIRSIZE.CMD', " * on your PATH. */"
  984.       call lineout 'DIRSIZE.CMD', "'@echo off'"
  985.       call lineout 'DIRSIZE.CMD', "mydir = directory()"
  986.       call lineout 'DIRSIZE.CMD', "arg arg1 arg2"
  987.       call lineout 'DIRSIZE.CMD', "if arg1 \= '' then "
  988.       call lineout 'DIRSIZE.CMD', "do"
  989.       call lineout 'DIRSIZE.CMD', "  if left(arg1,1,1) \= '/' then"
  990.       call lineout 'DIRSIZE.CMD', "  do"
  991.       call lineout 'DIRSIZE.CMD', "    arg0 = arg1"
  992.       call lineout 'DIRSIZE.CMD', "    arg1 = stream(arg1,'c','query exists')"
  993.       call lineout 'DIRSIZE.CMD', "    if arg1 = '' then"
  994.       call lineout 'DIRSIZE.CMD', "    do"
  995.       call lineout 'DIRSIZE.CMD', "      arg1 = directory(arg0)"
  996.       call lineout 'DIRSIZE.CMD', "      call directory mydir"
  997.       call lineout 'DIRSIZE.CMD', "    end"
  998.       call lineout 'DIRSIZE.CMD', "  end"
  999.       call lineout 'DIRSIZE.CMD', "end"
  1000.       call lineout 'DIRSIZE.CMD', "else arg1 = mydir"
  1001.       call lineout 'DIRSIZE.CMD', "n = setlocal()"
  1002.       call lineout 'DIRSIZE.CMD', "n = directory('"curdir"')"
  1003.       call lineout 'DIRSIZE.CMD', "'start dirsize.exe 'arg1 '%2 %3 %4 %5 %6 %7 %8 %9'"
  1004.       call lineout 'DIRSIZE.CMD', "n = endlocal()"
  1005.       call stream 'DIRSIZE.CMD','C','close'
  1006.     end
  1007.     else say "Couldn't create DIRSIZE.CMD file."
  1008.     'del UNDEL.CMD 1>NUL 2>NUL'
  1009.     dummy = stream('UNDEL.CMD','C','open')
  1010.     if dummy = 'READY:' then
  1011.     do
  1012.       say 'Creating an UNDEL.CMD file.'
  1013.       call lineout 'UNDEL.CMD', "/* UNDEL (FM/2) command file.  Locate in a directory"
  1014.       call lineout 'UNDEL.CMD', " * on your PATH. */"
  1015.       call lineout 'UNDEL.CMD', "'@echo off'"
  1016.       call lineout 'UNDEL.CMD', "n = setlocal()"
  1017.       call lineout 'UNDEL.CMD', "n = directory('"curdir"')"
  1018.       call lineout 'UNDEL.CMD', "'start undel.exe %1'"
  1019.       call lineout 'UNDEL.CMD', "n = endlocal()"
  1020.       call stream 'UNDEL.CMD','C','close'
  1021.     end
  1022.     else say "Couldn't create UNDEL.CMD file."
  1023.     'del KILLPROC.CMD 1>NUL 2>NUL'
  1024.     dummy = stream('KILLPROC.CMD','C','open')
  1025.     if dummy = 'READY:' then
  1026.     do
  1027.       say 'Creating a KILLPROC.CMD file.'
  1028.       call lineout 'KILLPROC.CMD', "/* KILLPROC (FM/2) command file.  Locate in a directory"
  1029.       call lineout 'KILLPROC.CMD', " * on your PATH. */"
  1030.       call lineout 'KILLPROC.CMD', "'@echo off'"
  1031.       call lineout 'KILLPROC.CMD', "n = setlocal()"
  1032.       call lineout 'KILLPROC.CMD', "n = directory('"curdir"')"
  1033.       call lineout 'KILLPROC.CMD', "'start killproc.exe'"
  1034.       call lineout 'KILLPROC.CMD', "n = endlocal()"
  1035.       call stream 'KILLPROC.CMD','C','close'
  1036.     end
  1037.     else say "Couldn't create KILLPROC.CMD file."
  1038.     'del VIEWINFS.CMD 1>NUL 2>NUL'
  1039.     dummy = stream('VIEWINFS.CMD','C','open')
  1040.     if dummy = 'READY:' then
  1041.     do
  1042.       say 'Creating a VIEWINFS.CMD file.'
  1043.       call lineout 'VIEWINFS.CMD', "/* VIEWINFS (FM/2) command file.  Locate in a directory"
  1044.       call lineout 'VIEWINFS.CMD', " * on your PATH. */"
  1045.       call lineout 'VIEWINFS.CMD', "'@echo off'"
  1046.       call lineout 'VIEWINFS.CMD', "n = setlocal()"
  1047.       call lineout 'VIEWINFS.CMD', "n = directory('"curdir"')"
  1048.       call lineout 'VIEWINFS.CMD', "'start viewinfs.exe'"
  1049.       call lineout 'VIEWINFS.CMD', "n = endlocal()"
  1050.       call stream 'VIEWINFS.CMD','C','close'
  1051.     end
  1052.     else say "Couldn't create VIEWINFS.CMD file."
  1053.     'del VIEWHELP.CMD 1>NUL 2>NUL'
  1054.     dummy = stream('VIEWHELP.CMD','C','open')
  1055.     if dummy = 'READY:' then
  1056.     do
  1057.       say 'Creating a VIEWHELP.CMD file.'
  1058.       call lineout 'VIEWHELP.CMD', "/* VIEWHELP (FM/2) command file.  Locate in a directory"
  1059.       call lineout 'VIEWHELP.CMD', " * on your PATH. */"
  1060.       call lineout 'VIEWHELP.CMD', "'@echo off'"
  1061.       call lineout 'VIEWHELP.CMD', "n = setlocal()"
  1062.       call lineout 'VIEWHELP.CMD', "n = directory('"curdir"')"
  1063.       call lineout 'VIEWHELP.CMD', "'start viewinfs.exe DUMMY'"
  1064.       call lineout 'VIEWHELP.CMD', "n = endlocal()"
  1065.       call stream 'VIEWHELP.CMD','C','close'
  1066.     end
  1067.     else say "Couldn't create VIEWHELP.CMD file."
  1068.     'del GLOBAL.CMD 1>NUL 2>NUL'
  1069.     dummy = stream('GLOBAL.CMD','C','open')
  1070.     if dummy = 'READY:' then
  1071.     do
  1072.       say 'Creating a GLOBAL.CMD file.'
  1073.       call lineout 'GLOBAL.CMD', "/* GLOBAL (FM/2) command file.  Locate in a directory"
  1074.       call lineout 'GLOBAL.CMD', " * on your PATH. */"
  1075.       call lineout 'GLOBAL.CMD', "'@echo off'"
  1076.       call lineout 'GLOBAL.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  1077.       call lineout 'GLOBAL.CMD', "if arg1 \= '' then "
  1078.       call lineout 'GLOBAL.CMD', "do"
  1079.       call lineout 'GLOBAL.CMD', "  if left(arg1,1,1) \= '/' then"
  1080.       call lineout 'GLOBAL.CMD', "  do"
  1081.       call lineout 'GLOBAL.CMD', "    arg1 = stream(arg1,'c','query exists')"
  1082.       call lineout 'GLOBAL.CMD', "  end"
  1083.       call lineout 'GLOBAL.CMD', "end"
  1084.       call lineout 'GLOBAL.CMD', "else arg1 = directory()"
  1085.       call lineout 'GLOBAL.CMD', "if arg2 \= '' then "
  1086.       call lineout 'GLOBAL.CMD', "do"
  1087.       call lineout 'GLOBAL.CMD', "  if left(arg2,1,1) \= '/' then"
  1088.       call lineout 'GLOBAL.CMD', "  do"
  1089.       call lineout 'GLOBAL.CMD', "    arg2 = stream(arg2,'c','query exists')"
  1090.       call lineout 'GLOBAL.CMD', "  end"
  1091.       call lineout 'GLOBAL.CMD', "end"
  1092.       call lineout 'GLOBAL.CMD', "if arg3 \= '' then "
  1093.       call lineout 'GLOBAL.CMD', "do"
  1094.       call lineout 'GLOBAL.CMD', "  if left(arg3,1,1) \= '/' then"
  1095.       call lineout 'GLOBAL.CMD', "  do"
  1096.       call lineout 'GLOBAL.CMD', "    arg3 = stream(arg3,'c','query exists')"
  1097.       call lineout 'GLOBAL.CMD', "  end"
  1098.       call lineout 'GLOBAL.CMD', "end"
  1099.       call lineout 'GLOBAL.CMD', "if arg4 \= '' then "
  1100.       call lineout 'GLOBAL.CMD', "do"
  1101.       call lineout 'GLOBAL.CMD', "  if left(arg4,1,1) \= '/' then"
  1102.       call lineout 'GLOBAL.CMD', "  do"
  1103.       call lineout 'GLOBAL.CMD', "    arg4 = stream(arg4,'c','query exists')"
  1104.       call lineout 'GLOBAL.CMD', "  end"
  1105.       call lineout 'GLOBAL.CMD', "end"
  1106.       call lineout 'GLOBAL.CMD', "if arg5 \= '' then "
  1107.       call lineout 'GLOBAL.CMD', "do"
  1108.       call lineout 'GLOBAL.CMD', "  if left(arg5,1,1) \= '/' then"
  1109.       call lineout 'GLOBAL.CMD', "  do"
  1110.       call lineout 'GLOBAL.CMD', "    arg5 = stream(arg5,'c','query exists')"
  1111.       call lineout 'GLOBAL.CMD', "  end"
  1112.       call lineout 'GLOBAL.CMD', "end"
  1113.       call lineout 'GLOBAL.CMD', "if arg6 \= '' then "
  1114.       call lineout 'GLOBAL.CMD', "do"
  1115.       call lineout 'GLOBAL.CMD', "  if left(arg6,1,1) \= '/' then"
  1116.       call lineout 'GLOBAL.CMD', "  do"
  1117.       call lineout 'GLOBAL.CMD', "    arg6 = stream(arg6,'c','query exists')"
  1118.       call lineout 'GLOBAL.CMD', "  end"
  1119.       call lineout 'GLOBAL.CMD', "end"
  1120.       call lineout 'GLOBAL.CMD', "if arg7 \= '' then "
  1121.       call lineout 'GLOBAL.CMD', "do"
  1122.       call lineout 'GLOBAL.CMD', "  if left(arg7,1,1) \= '/' then"
  1123.       call lineout 'GLOBAL.CMD', "  do"
  1124.       call lineout 'GLOBAL.CMD', "    arg7 = stream(arg7,'c','query exists')"
  1125.       call lineout 'GLOBAL.CMD', "  end"
  1126.       call lineout 'GLOBAL.CMD', "end"
  1127.       call lineout 'GLOBAL.CMD', "if arg8 \= '' then "
  1128.       call lineout 'GLOBAL.CMD', "do"
  1129.       call lineout 'GLOBAL.CMD', "  if left(arg8,1,1) \= '/' then"
  1130.       call lineout 'GLOBAL.CMD', "  do"
  1131.       call lineout 'GLOBAL.CMD', "    arg8 = stream(arg8,'c','query exists')"
  1132.       call lineout 'GLOBAL.CMD', "  end"
  1133.       call lineout 'GLOBAL.CMD', "end"
  1134.       call lineout 'GLOBAL.CMD', "if arg9 \= '' then "
  1135.       call lineout 'GLOBAL.CMD', "do"
  1136.       call lineout 'GLOBAL.CMD', "  if left(arg9,1,1) \= '/' then"
  1137.       call lineout 'GLOBAL.CMD', "  do"
  1138.       call lineout 'GLOBAL.CMD', "    arg9 = stream(arg9,'c','query exists')"
  1139.       call lineout 'GLOBAL.CMD', "  end"
  1140.       call lineout 'GLOBAL.CMD', "end"
  1141.       call lineout 'GLOBAL.CMD', "n = setlocal()"
  1142.       call lineout 'GLOBAL.CMD', "n = directory('"curdir"')"
  1143.       call lineout 'GLOBAL.CMD', "'start global.exe' arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  1144.       call lineout 'GLOBAL.CMD', "n = endlocal()"
  1145.       call stream 'GLOBAL.CMD','C','close'
  1146.     end
  1147.     else say "Couldn't create GLOBAL.CMD file."
  1148.     say ""
  1149.     parse upper var curdir curdir
  1150.     say "Please add the directory"
  1151.     say "  "curdir"\UTILS"
  1152.     say "to your PATH in CONFIG.SYS."
  1153.     say "┌──────────────────────────────────────────────────────────────────┐"
  1154.     say "│Remember, you'll need to reboot before such a change takes effect.│"
  1155.     say "│FM/2 will run fine from its WPS objects without this change; the  │"
  1156.     say "│proposed change allows it to be run from any command line, and for│"
  1157.     say "│other programs that might want to use FM/2 as its file manager to │"
  1158.     say "│find and run it easily.                                           │"
  1159.     say "└──────────────────────────────────────────────────────────────────┘"
  1160.     say "While you're in there, check your LIBPATH statement for a '.' entry..."
  1161.     if existed = 'EXISTED' then
  1162.     do
  1163.       say ""
  1164.       if unattended = 'UNATTENDED' then
  1165.       do
  1166.         call charout ,'  Press [Enter] for more...'
  1167.         dummy = ''
  1168.         do until dummy = '0d'x
  1169.           dummy = SysGetKey('NOECHO')
  1170.         end
  1171.         call charout ,'0d1b'x'[K'
  1172.       end
  1173.       rc = stream('fatopt.exe','c','query exists')
  1174.       say   "┌────────────────────────────────────────────────────────────────┐"
  1175.       if rc = '' then
  1176.       do
  1177.         say "│I suggest that you place the utilities from the FM/2 Utilities  │"
  1178.         say "│archive in this directory, also, in which case you should       │"
  1179.         say "│_definitely_ make the change to PATH so that FM/2 can find them.│"
  1180.       end
  1181.       say   "│You may want to tweak the command lines in the .CMD files I just│"
  1182.       say   "│built and/or those in the WPS objects in the FM/2 folder for    │"
  1183.       say   "│desired specific behaviors.  The READ.ME file will tell you how.│"
  1184.       say   "└────────────────────────────────────────────────────────────────┘"
  1185.     end
  1186.     if existed = '' then
  1187.     do
  1188.       say ''
  1189.       say "If you have previously altered your CONFIG.SYS's PATH statement"
  1190.       say 'as instructed above, please ignore this rambling.'
  1191.     end
  1192.     say ""
  1193.     if unattended = 'UNATTENDED' then
  1194.     do
  1195.       call charout ,'  Press [Enter] to continue...'
  1196.       dummy = ''
  1197.       do until dummy = '0d'x
  1198.         dummy = SysGetKey('NOECHO')
  1199.       end
  1200.       call charout ,'0d1b'x'[K'
  1201.     end
  1202.   end
  1203.   else say "Couldn't create FM2.CMD file.  Panic."
  1204.   dummy = directory(curdir)
  1205. end
  1206. else say "Couldn't switch to "curdir"\utils"
  1207.  
  1208. /* type the install.dat file to show any critical info/notices */
  1209.  
  1210. rc = stream('install.dat','c','query exists')
  1211. if rc \= '' then
  1212. do
  1213.   'type install.dat'
  1214.   'DEL INSTALL.DAT 1>NUL 2>NUL'
  1215.   if unattended = 'UNATTENDED' then
  1216.   do
  1217.     call charout ,'  Press [Enter] to continue...'
  1218.     dummy = ''
  1219.     do until dummy = '0d'x
  1220.       dummy = SysGetKey('NOECHO')
  1221.     end
  1222.     call charout ,'0d1b'x'[K'
  1223.   end
  1224. end
  1225.  
  1226. /* Final words */
  1227.  
  1228. say '┌──────────────────────────────────────────────────────────────────────────┐'
  1229. say '│To move FM/2 to another directory, move the files, delete the FM/2 folder,│'
  1230. say '│then rerun INSTALL.  There is no need to "uninstall" to move FM/2.        │'
  1231. say '│                                                                          │'
  1232. say '│To remove FM/2 completely, run UNINSTAL and follow its directions.        │'
  1233. say '└──────────────────────────────────────────────────────────────────────────┘'
  1234. say "I'm done now."
  1235. say ''
  1236.  
  1237.